<?php
require_once './connect.php';
//处理数据
$app_id=$data['app_id'];
$ord_time=$data['ord_time'];
$use_id=$data['use_id'];
$sql = "INSERT INTO _order(app_id,ord_time,use_id)VALUES ('$app_id','$ord_time','$use_id')";
if ($conn->query($sql) === TRUE) {
    $resultCode= '0';
} else {
    $resultCode ='1';
}
//UPDATE cs_user SET gender = '男' WHERE id = 4
$sql="UPDATE _appoint SET app_have = app_have+1 WHERE app_id = $app_id";
if ($conn->query($sql) === TRUE) {
    $resultCode= '0';
} else {
    $resultCode ='1';
}

//$sql = "INSERT INTO _order(app_id,ord_time,use_id)VALUES ('$app_id','$ord_time','$use_id')";
$datalist=array('dataList' => $datalist);
$response=array(
    'resultCode'=> $resultCode,
    'resultObject'=> $datalist,
    'resultMsg'=>'成功'
);
//echo 'test';
echo json_encode($response);
$conn->close();
?>